﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

// std headers
#include <string>

// custom headers
#include "GcsService.h"


namespace gdc
{
    class ICollaborationProject;
}

namespace gmepgcs
{
    class GCS_SERVICE_EXPORTS UserService
    {
    private:
        explicit UserService() = default;
        UserService(UserService&) = delete;
        UserService &operator=(UserService &) = delete;
        virtual ~UserService();
        
    public:
        static UserService *Get();

    public:
        static UserService *s_pInstance;
        bool Login(const std::wstring &userName, const std::wstring &password, std::wstring &message);
        std::wstring GetToken();
        std::wstring GetUserId();
        int GetPermissionInCollaborationProject(const std::wstring& datasetId, const std::wstring &permesionKey = L"GJK") const;

        std::wstring GetTokenInQa();

        // 获取私有化环境下的gjw token
        std::wstring GetPrivateGjwToken();
    };
}